import request from "@/utils/request.js"
const FileById = request.FileById;
const FileUpload = request.FileUpload

const getPhotograph = (x)=>{
	return request.get('/Photograph/GetBySelect?searchValue=0&&pageIndex='+x.pageIndex+'&&pageSize='+x.pageSize+'&&extendedValue5=1')
}
const searchPhotograph = (x)=>{
	return request.get('/Photograph/GetBySelect?searchValue='+x.searchValue+'&searchName='+x.searchName+'&pageIndex=1&pageSize=1000')
}
const follow = (id)=>{
	return request.post('/Follow/Add',{followerId:id})
}
const getDimensionsById = (id)=>{
	return request.get('/File/GetDimensionsById?id='+id)
}
const getPhotographById = (id)=>{
	return request.get('/Photograph/GetById?id='+id)
}
const getCommentByPhotographId = (id)=>{
	return request.get('/Comment/GetBySelect?searchValue='+id+'&pageIndex=1')
}
const upload = async (data)=>{
	return await request.upload(data)
}
const getPhotographTypes = ()=>{
	return request.get('/PhotographType/Get')
}
const releasePhotograph = (data)=>{
	return request.post('/Photograph/add',data)
}
const likeChange = (id)=>{
	return request.post('/Like/PhotographLike',{value1:id})
}
const getPhotographWithLikeStatusById = (id)=>{
	return request.get('/Photograph/GetPhotographWithLikeStatusById?id='+id)
}
const getStar = ()=>{
	return request.get('/star/GetBySelect')
}
const addStarItem = (data)=>{
	return request.post('/StarItem/add',data)
}

const removeStarItem = (id)=>{
	return request.del('/starItem/remove?photographId='+id)
}
const getReportType  =()=>{
	return request.get('/ReportType/get')
}
	
const addPhotoReport = (data)=>{
	return request.post('/PhotographReport/Add',data)
}

const addComment =(data)=>{
	return request.post('/Comment/Add',data)
}

const getPhotographByFollow = ()=>{
	return request.get('/Photograph/GetPhotographByFollow')
}

const unFollow = (id)=>{
	return request.del('/Follow/UnFollow?followerId='+id)
}

const addHistory=(id)=>{
	return request.get('/Photograph/AddHistory?photographId='+id)
}

export default{
	addHistory,
	unFollow,
	searchPhotograph,
	getPhotographByFollow,
	addComment,
	addPhotoReport,
	getReportType,
	removeStarItem,
	addStarItem,
	getStar,
	getPhotographWithLikeStatusById,
	likeChange,
	releasePhotograph,
	getPhotographTypes,
	upload,
	FileById,
	FileUpload,
	getPhotograph,follow,
	getDimensionsById,
	getPhotographById,
	getCommentByPhotographId
}